home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ultra250.zip / UW_PROTO.H < prev    next >
Text File  |  1992-10-25  |  14KB  |  347 lines

  1. /****************************************************************************/
  2. /*                                                                                                                                                    */
  3. /* UW_PROTO.H                                                                                                                             */
  4. /*                                                                                                                                                    */
  5. /* Prototype file for UltraWin.                                             */
  6. /*                                                                                                                    Kevin Huck            */
  7. /*                                                                                                                    Boyd Gafford        */
  8. /*                                                                                                                                                    */
  9. /****************************************************************************/
  10. #ifndef __UW_PROTO_H
  11. #define __UW_PROTO_H
  12.  
  13. /*------------------------- Prototypes for UW_MGR.C ------------------------*/
  14. void reset_all_masks( void );
  15. void refresh_desktop( void );
  16. void refresh_column( int col );
  17. void refresh_row( int row );
  18. void redisplay_rect( RECT *rectp );
  19. void add_wn_mask( WINDOW *wnp );
  20. void remove_wn_mask( WINDOW *wnp );
  21. void col_wn_mask( int x_pos, int y_min, int y_max, int amount );
  22. void row_wn_mask( int y_pos, int x_min, int x_max, int amount );
  23. void set_window_attr( void );
  24. WINDOW *end_window( WINDOW *wnp );
  25. WINDOW *cr_inwindow( int col, int row );
  26. WINDOW *link_window( WINDOW *wnp );
  27. int unlink_window( WINDOW *wnp );
  28. int remove_window_ll( int destroy_mode, WINDOW *wnp );
  29. void pull_to_top( WINDOW *wnp );
  30. int make_top_window( WINDOW *wnp );
  31. void move_wn_left( int cols, WINDOW *wnp );
  32. void move_wn_right( int cols, WINDOW *wnp );
  33. void move_wn_up( int rows, WINDOW *wnp );
  34. void move_wn_down( int rows, WINDOW *wnp );
  35. void set_rect(RECT *rectp, int x1, int y1, int x2, int y2);
  36. int is_rect_equal( RECT *r1, RECT *r2 );
  37. int rect_enclosed(RECT *r1, RECT *r2);
  38. int rect_overlap(RECT *r1, RECT *r2);
  39. void offset_rect(RECT *rectp, int col, int row);
  40. int col_row_inrect(int col, int row, RECT *rectp);
  41.  
  42. /*------------------------- Prototypes for UW_FONT.C ------------------------*/
  43. int encode_color(int r, int g, int b);
  44. void decode_color(int color, int *r, int *g, int *b);
  45. void write_palette( int pnum, uchar val );
  46. void write_palette_all( uchar *vals );
  47. int read_palette( int pnum );
  48. void read_palette_all( uchar *vals );
  49. void set_block_ab(int a, int b);
  50. void blink_enable(int state);
  51. void replicate_enable(int state);
  52. int load_font( uchar *font, char *fname );
  53. int save_font( uchar *font, char *fname, int scan_lines );
  54. void rom8x8(int block, int setmode);
  55. void rom8x14(int block, int setmode);
  56. void rom8x16(int block, int setmode);
  57.  
  58. /*------------------------- Prototypes for UW_ENTRY.C ------------------------*/
  59. void up_first_char( char *wk_str, char *mask, int mode );
  60. void disp_entry( int c, int r, uchar m_att, char *s, char *m,
  61.                                  int offset, int disp_width, int arrow_flag, WINDOW *wnp );
  62. void g_insert( char *s, char *m, char *t, int pos );
  63. void g_delete( char *s, char *m, char *t, int pos );
  64. void g_rtl_insert( char *s, char *m, char *t, int pos );
  65. void g_rtl_delete( char *s, char *m, char *t, int pos );
  66. void add_mask( char *s, char *m, char *t );
  67. int rmv_mask( char *s, char *t );
  68. int validate( char *c, char t );
  69. void strip_entry( char *s, char *m );
  70. void strip_end( char *s, char *m );
  71. void strip_start( char *s, char *m );
  72. int strip_len( char *s, char *m );
  73. int wn_gets( char *str, char *mask, char *tplt, uchar m_att,
  74.                          int strip_mode, WINDOW *wnp );
  75. int init_gets_str( char *s, char *m, char *t, char *wk );
  76. void rev_init_gets_str( char *s, char *m, char *t, char *wk );
  77. void reverse_str( char *s );
  78. int wn_gets_ll( char *str, char *mask, char *tplt, uchar m_att,
  79.                                 int flags, int disp_width, WINDOW *wnp );
  80. void set_validation_func( int (*func_ptr)(char*, char*, char*, 
  81.                                                     int, int, WINDOW*) );
  82. void set_gets_hook( int (*func_ptr)(char*, char*, char*, int, int, 
  83.                                         int, EVENT*, WINDOW*) );
  84.  
  85. /*------------------------- Prototypes for UW_MENU.C ------------------------*/
  86. void menu_st( MENU *mnp, int csr, int inx);
  87. int menu_create( int x_min, int y_min, int x_max, int y_max, int direction,
  88.                            uchar back_att, uchar bdr_att, uchar csr_att, uchar first_att,
  89.                              int bdr, int type, MENU *mnp );
  90. int item_add( char *entry, int id, int first_pos, MENU *mnp );
  91. void menu_set( MENU *mnp );
  92. void menu_restore( MENU *mnp );
  93. void menu_destroy( MENU *mnp );
  94. void decrement_csr( int *csr, int min, int max);
  95. void increment_csr( int *csr, int min, int max);
  96. int upkey( int key );
  97. int menu_horiz( MENU *mnp, int proc_mode );
  98. int menu_vert( MENU *mnp, int proc_mode );
  99. int do_menu( MENU *mnp, int proc_mode );
  100. int menu_system( MENU *top_mnp, MENU *dropmenu[], int draw_top );
  101. int menu_system_ll( MENU *top_mnp, MENU *dropmenu[], int draw_top,
  102.                                       int first_key, int exit_mode );
  103.  
  104. /*------------------------- Prototypes for UW_PRTF.C ------------------------*/
  105. int wn_printf( WINDOW *wnp, char *fmt, ... );
  106.  
  107. /*------------------------- Prototypes for UW_RFSH.C ------------------------*/
  108. void move_n_to_f( int *s, int dest_seg, int dest_off, int cnt );
  109. void move_f_to_n( int src_seg, int src_off, int *d, int cnt );
  110. void wn_io( int dir, int area, WINDOW *wnp );
  111. void wn_rfsh_line( int line, WINDOW *wnp );
  112. void wn_rfsh_col( int col, WINDOW *wnp );
  113.  
  114. /*------------------------- Prototypes for UW_WN.C  ------------------------*/
  115. int wn_create( int x_min, int y_min, int x_max, int y_max, int bdr, int mode, WINDOW *wnp );
  116. void wn_destroy( WINDOW *wnp );
  117. void wn_set( WINDOW *wnp );
  118. void wn_clear( WINDOW *wnp );
  119. void wn_move( int col, int row, WINDOW *wnp );
  120. int wn_size( int x_min, int y_min, int x_max, int y_max, WINDOW *wnp );
  121.  
  122. /*------------------------- Prototypes for UW_LL.C  ------------------------*/
  123. int _csr_adj( WINDOW *wnp );
  124. void _wn_scroll( int dir, WINDOW *wnp );
  125. uchar far *_calc_scr_addr(WINDOW *wnp);
  126. uchar *_calc_buff_addr(WINDOW *wnp);
  127. uchar *_calc_mask_addr(WINDOW *wnp);
  128. void _calc_all_addr(uchar far **scr, uchar **buff, uchar **mask, WINDOW *wnp);
  129. void _fill_rect( uchar att, int v, RECT *rp );
  130.  
  131. /*------------------------- Prototypes for UW_BDR.C ------------------------*/
  132. void wn_co( int cnt, uchar c, WINDOW *wnp );
  133. void wn_border( WINDOW *wnp );
  134. void wn_hline(int row, int style, WINDOW *wnp);
  135. void wn_vline(int col, int style, WINDOW *wnp);
  136.  
  137. /*------------------------- Prototypes for UW_MASK.C ------------------------*/
  138. void adjust_mask_col( int x_pos, int y_min, int y_max, int amount, WINDOW *wnp );
  139. void adjust_mask_row( int y_pos, int x_min, int x_max, int amount, WINDOW *wnp );
  140. void set_mask( int mode, WINDOW *wnp1, WINDOW *wnp2 );
  141. void clear_mask( WINDOW *wnp );
  142.  
  143. /*------------------------- Prototypes for UW_TERM.C ------------------------*/
  144. void wn_claol( WINDOW *wnp );
  145. void wn_cleol( WINDOW *wnp );
  146. void wn_clbol( WINDOW *wnp );
  147. void wn_cleos( WINDOW *wnp );
  148. void wn_clbos( WINDOW *wnp );
  149. void wn_claos( WINDOW *wnp );
  150. void wn_cln(int qty, WINDOW *wnp);
  151. void wn_clear_tabs( WINDOW *wnp );
  152. void wn_init_tabs( int space, WINDOW *wnp );
  153. void wn_set_tab( WINDOW *wnp );
  154. void wn_reset_tab( WINDOW *wnp );
  155. void wn_tab_right( int cnt, WINDOW *wnp );
  156. void wn_tab_left( int cnt, WINDOW *wnp );
  157. void wn_ins_del_chars(int mode, char c, int cnt, WINDOW *wnp );
  158. void wn_ins_del_lines(int mode, char c, int cnt, WINDOW *wnp );
  159. void wn_csr_dn( int qty, WINDOW *wnp );
  160. void wn_csr_up( int qty, WINDOW *wnp );
  161. void wn_csr_left( int qty, WINDOW *wnp );
  162. void wn_csr_right( int qty, WINDOW *wnp );
  163. void wn_csr_pos( int line, int col, WINDOW *wnp );
  164. void wn_scroll_reg( int line_s, int line_e, WINDOW *wnp );
  165. void wn_bksp( int qty, WINDOW *wnp );
  166.  
  167. /*------------------------- Prototypes for UW_GRAPH.C ------------------------*/
  168. int init_uw_graphics( int xres, int yres, int font_rows, int font_spacing,
  169.                                             int seg, int off );
  170. int g_ch( int c, int r, uchar v );
  171. void install_font(uchar *font, int block, int ofs, int cnt,
  172.                                     int scan_lines, int setmode );
  173. uchar far *get_font_info( int typ, int *scan_lines, int *rows );
  174.  
  175. /*------------------------- Prototypes for UW_ST.C  ------------------------*/
  176. void wn_st( char *s, WINDOW *wnp );
  177. void wn_st_qty( char *s, int qty, WINDOW *wnp );
  178. void wn_plst( int col, int line, char *s, WINDOW *wnp );
  179. void wn_st_fmt( char *s, WINDOW *wnp );
  180. int get_word( char *s, char *word );
  181.  
  182. /*------------------------- Prototypes for UW_CSR.C ------------------------*/
  183. void rd_csr( int *col, int *line );
  184. void mv_csr( int col, int line );
  185. void csr_style( int style );
  186. void csr_hide(void);
  187. void csr_show(void);
  188. void pl_csr( WINDOW *wnp );
  189.  
  190. /*------------------------- Prototypes for UW_CH.C  ------------------------*/
  191. void wn_ch( uchar c, WINDOW *wnp );
  192. void wn_noatt_ch( uchar c, WINDOW *wnp );
  193. uchar wn_och( WINDOW *wnp );
  194. uchar wn_oatt( WINDOW *wnp );
  195. void wn_qch( int cnt, uchar c, WINDOW *wnp );
  196.  
  197. /*------------------------- Prototypes for UW_PRINT.C ------------------------*/
  198. int  init_printer( char *fname, char *diskbuff, long isize, long msize, PRINT *p );
  199. int  end_printer( PRINT *p );
  200. int  realloc_printer( long new_size, PRINT *p );
  201. void set_prt_xlat( int state, uchar *xlat, PRINT *p );
  202. int  print_char( uchar c, PRINT *p );
  203. int  print_str( uchar *str, PRINT *p );
  204. int  print_printf( PRINT *p, char *fmt, ... );
  205. int  print_data( uchar *data, int cnt, PRINT *p );
  206. int  print_file( char *fname, PRINT *p );
  207. int  print_window( WINDOW *wnp, PRINT *p );
  208. int  print_screen( PRINT *p );
  209. int  print_eol( PRINT *p );
  210. int  print_in_bkgrnd( void );
  211.  
  212. /*------------------------- Prototypes for UW_EVENT.C ------------------------*/
  213. void m_reset(M_RESET *m);
  214. void m_colrange( int col_min, int col_max );
  215. void m_rowrange( int row_min, int row_max );
  216. void init_mouse(void);
  217. void end_mouse(void);
  218. void m_show(void);
  219. void m_hide(void);
  220. void m_pos( M_LOC *m );
  221. void m_moveto( int col, int row );
  222. void m_pressed( int button, M_LOC *m );
  223. void m_released( int button, M_LOC *m );
  224. void m_textcursor(int curstype, uint arg1, uint arg2);
  225. void m_motion( M_MOVE *m );
  226. void m_lpen_on(void);
  227. void m_lpen_off(void);
  228. void m_ratio( int horiz, int vert );
  229. void wait_ticks( clock_t ticks );
  230. int get_key(void);
  231. int check_key(void);
  232. void set_key_func( int (*func_ptr)(int, int) );
  233. int event_pending(void);
  234. void set_idle_func( int (*func_ptr)(void) );
  235. void wait_event(void);
  236.  
  237. /*------------------------- Prototypes for UW_VID.C ------------------------*/
  238. void set_25_rows(void);
  239. int get_num_rows(void);
  240. void get_v_mode(void);
  241. void init_video(int cols, int rows);
  242. void set_vid_addr( int segment, int offset );
  243. void force_video(int force_mode, int cols, int rows);
  244. void end_video(void);
  245. uchar swap_nibbles( uchar c );
  246. uchar get_att( uchar att );
  247. void check_desq(void);
  248. void mode43(void);
  249. void mode25(void);
  250. int ega_vga_check(void);
  251. void init_clock(uint speed);
  252. void end_clock(void);
  253. void clock_speed( uint speed );
  254. void tone( uint freq, int dur );
  255. void sound_off(void);
  256. void wait_ticks( clock_t ticks );
  257. #ifdef __ZTC__
  258. void interrupt far *getvect(int vect_no);
  259. void setvect(int vect_no, void interrupt far *fp);
  260. #endif
  261.  
  262. /*------------------------- Prototypes for UW_KBD.C ------------------------*/
  263. void     init_ctrlc_hdlr(void);
  264. void  end_ctrlc_hdlr(void);
  265.  
  266. /*------------------------- Prototypes for UW_DBG.C ------------------------*/
  267. #if defined(ENQ_DEBUG) || defined(SOURCE_TRACE)
  268. int enq_error( int parm1, int parm2, char *s1, char *s2, void *p );
  269. int wnp_vld( char *s, int mode, WINDOW *wnp );
  270. int prtp_vld( char *s, int mode, PRINT *prtp );
  271. int p_vld( char *s, void *gp );
  272. int menup_vld( char *s, int mode, MENU *menup );
  273. void dbg__log( char *func_name );
  274. void linearize_log(void);
  275. void dbg_push( char *func_name );
  276. void dbg_pop( void );
  277.  
  278. void wn_att( uchar att, WINDOW *wnp );
  279. void wn_color(int f, int b, WINDOW *wnp);
  280. void wn_bdratt(uchar att, WINDOW *wnp);
  281. void wn_bdr_color(int f, int b, WINDOW *wnp);
  282. void mv_cs(int c, int r, WINDOW *wnp);
  283. int wn_rqty(WINDOW *wnp);
  284. int wn_sqty(WINDOW *wnp);
  285. int wn_cqty(WINDOW *wnp);
  286. void wn_name(char *n, WINDOW *wnp);
  287. void wn_name_loc(int l, WINDOW *wnp);
  288. void wn_save( WINDOW *wnp );
  289. void wn_restore( WINDOW *wnp );
  290. void wn_rfsh( WINDOW *wnp );
  291. void wn_read( WINDOW *wnp );
  292.  
  293. int wn_get_csr_x(WINDOW *wnp);
  294. int wn_get_csr_y(WINDOW *wnp);
  295. uchar wn_get_att(WINDOW *wnp);
  296. uchar wn_get_bdratt(WINDOW *wnp);
  297. int wn_get_rows(WINDOW *wnp);
  298. int wn_get_cols(WINDOW *wnp);
  299. int wn_get_bdr_style(WINDOW *wnp);
  300. int wn_get_name_loc(WINDOW *wnp);
  301.  
  302. int wn_is_hidden(WINDOW *wnp);
  303. int wn_is_overlapped(WINDOW *wnp);   
  304. int wn_is_csr_adv(WINDOW *wnp);
  305. int wn_is_inside(WINDOW *wnp);
  306. int wn_is_mask_on(WINDOW *wnp);
  307. int wn_is_popup(WINDOW *wnp);
  308. int wn_is_scroll(WINDOW *wnp);
  309. int wn_is_bs_clear(WINDOW *wnp);
  310. int wn_is_eol_wrap(WINDOW *wnp);
  311. int wn_is_mgr_flag(WINDOW *wnp);
  312. int wn_is_set_flag(WINDOW *wnp);
  313. int wn_is_cr_flag(WINDOW *wnp);
  314. int wn_is_lf_flag(WINDOW *wnp);
  315. int wn_is_cr_lf_flag(WINDOW *wnp);
  316. int wn_is_bk_flag(WINDOW *wnp);
  317. int wn_is_tab_flag(WINDOW *wnp);
  318. int wn_is_bell_flag(WINDOW *wnp);
  319. int wn_is_w_wrap(WINDOW *wnp);
  320. void wn_set_csr_x(int x, WINDOW *wnp);
  321. void wn_set_csr_y(int y, WINDOW *wnp);
  322. void wn_set_bdr_style(int state,WINDOW *wnp);
  323. void wn_set_name_loc(int state,WINDOW *wnp);
  324. void wn_set_hidden(int state,WINDOW *wnp);
  325. void wn_set_overlapped(int state,WINDOW *wnp);
  326. void wn_set_csr_adv(int state,WINDOW *wnp);
  327. void wn_set_inside(int state,WINDOW *wnp);
  328. void wn_set_mask_on(int state,WINDOW *wnp);
  329. void wn_set_popup(int state,WINDOW *wnp);
  330. void wn_set_scroll(int state,WINDOW *wnp);
  331. void wn_set_bs_clear(int state,WINDOW *wnp);
  332. void wn_set_eol_wrap(int state,WINDOW *wnp);
  333. void wn_set_mgr_flag(int state,WINDOW *wnp);
  334. void wn_set_set_flag(int state,WINDOW *wnp);
  335. void wn_set_cr_flag(int state,WINDOW *wnp);
  336. void wn_set_lf_flag(int state,WINDOW *wnp);
  337. void wn_set_cr_lf_flag(int state,WINDOW *wnp);
  338. void wn_set_bk_flag(int state,WINDOW *wnp);
  339. void wn_set_tab_flag(int state,WINDOW *wnp);
  340. void wn_set_bell_flag(int state,WINDOW *wnp);
  341. void wn_set_w_wrap(int state,WINDOW *wnp);
  342. #endif
  343.  
  344. #endif /* __UW_PROTO_H */
  345.  
  346. /**** END OF FILE ****/
  347.